/*

Author   : chaos

FileName : stl_alg_com.cpp

Date     : 17/08/17 16:01:55

*/
#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc ,char *argv[])
{
    char a[] = {'B','G','C','E'};
    vector<char> v1(a,a+4),v2(a,a+4);

    bool result = equal(v1.begin() ,v1.end(),v2.begin());

    if(result)
        cout << "Two containers are the same !" << endl;
    else
        cout << "Two containers are different !" << endl;

    replace(v2.begin(),v2.end(),'G','H');

    pair<vector<char>::iterator,vector<char>::iterator> diff_elem;

    diff_elem = mismatch(v1.begin() ,v1.end(),v2.begin());

    cout << "v1 :" << *(diff_elem.first) << " v2 : " << *(diff_elem.second) << endl;

    return 0;
}
